home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 8
/
The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO
/
g_quake
/
bort22.zip
/
SHELLS.QC
< prev
Wrap
Text File
|
1996-10-09
|
3KB
|
86 lines
//====================================================================
//
// SHOTGUN SHELLS by: Perecli Manole AKA Bort
//
//====================================================================
// Aside from this new file, the following are the modifications
// done to id's original source files:
//--------------------------------------------------------------------
// File: Progs.src
// Location: before the "weapons.qc" line
// Added: shells.qc
//--------------------------------------------------------------------
// File: Weapons.qc
// Procedure: W_Precache
// Location: end of procedure
// Added: precache_sound ("weapons/shellhit.wav"); // shotgun shells
//--------------------------------------------------------------------
// File: World.qc
// Procedure: worldspawn
// Location: at the end of all precache model definitions
// Added: precache_model ("progs/shell.mdl");
//--------------------------------------------------------------------
// File: Weapons.qc
// Procedure: W_FireShotgun
// Location: before "FireBullets (6, dir, '0.04 0.04 0');" line
// Added: SpawnShell();
//--------------------------------------------------------------------
// File: Weapons.qc
// Procedure: W_FireSuperShotgun
// Location: before "FireBullets (14, dir, '0.14 0.08 0');" line
// Added: SpawnShell(); SpawnShell();
//--------------------------------------------------------------------
// File: Client.qc
// Procedure: ClientConnect
// Location: next line after bprint (" entered the game\n");
// Added: centerprint("This server supports: ...bla.bla.bla..");
//--------------------------------------------------------------------
float () crandom; // prototype
//--------------------------------------------------------------------
// Plays hit sound when shell hits hard surface if not stuck in loop
//--------------------------------------------------------------------
void() ShellHit =
{
if (self.ltime <= (time - 0.2)) // prevent sound if last shell hit sound occured within last 2 frames
sound (self, CHAN_WEAPON, "weapons/shellhit.wav", 1, ATTN_NORM);
self.ltime = time; // marks time of current touch trigger activation
};
//--------------------------------------------------------------------
// Displays shell and defines its dynamic manifestation
//--------------------------------------------------------------------
void() DropShell =
{
self.movetype = MOVETYPE_BOUNCE;
self.solid = SOLID_BBOX;
setmodel (self, "progs/shell.mdl");
setsize (self, VEC_ORIGIN, VEC_ORIGIN);
makevectors (self.owner.v_angle);
setorigin (self, self.owner.origin + v_forward * 10 - v_right*10);
self.velocity = v_forward*30 + crandom()*v_forward*30 + v_up*220 + crandom()*v_up*10 - v_right*50 + crandom()*v_right*20;
self.avelocity_x = crandom()*500;
self.avelocity_y = crandom()*500;
self.avelocity_z = crandom()*500;
self.touch = ShellHit;
self.nextthink = time + 15;
self.think = SUB_Remove;
self.ltime = time - 1;
};
//--------------------------------------------------------------------
// Spawns new shell entity but doesn't display it until reload time
//--------------------------------------------------------------------
void() SpawnShell=
{
local entity shell;
shell = spawn ();
shell.owner = self;
shell.nextthink = time + 0.4; // delay shells until reload
shell.think = DropShell;
};